home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 10
/
FM Towns Free Software Collection 10.iso
/
tos_updt
/
fmcity
/
palcom
/
system.m
< prev
Wrap
Text File
|
1995-04-12
|
55KB
|
1,813 lines
//--------------------------------------------------------------------------//
// PALCOM V2.1 L10 //
// システムスクリプト //
// //
// CopyRight(C) 1994/08/15 //
// FUJITSU PERSONAL COMPUTER SYSTEMS LIMITED //
// written by C-cube Soft H.Nakamura //
//--------------------------------------------------------------------------//
//##########################################################################//
//### セットブロック ###//
//##########################################################################//
!!SETBLOCK
$$CENTER.TYPE = [""];
// $$PRIORITY.FORE = 10;
// $$PRIORITY.BACK = 1;
$$PRIORITY.FORE = 0;
$$PRIORITY.BACK = 0;
!!ENDBLOCK
//##########################################################################//
//### ボタンブロック ###//
//##########################################################################//
!!BUTTONBLOCK
//------------------- ツールパネルのボタン設定 ------------------------//
button BTN_TRANSOPERATION {
obj.makeButton("通信画面の操作", #TRUE, 0, 2, 546);
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//通信画面の操作スクリプト起動
script.openExtern("BT_TOPER.MX", #FALSE, []);
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
return;
}
}
button BTN_TELCALL {
obj.makeButton("電話をかける", #TRUE, 0, 2, 542);
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//電話をかける関数呼出し
local.btn.telCall();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button DIS_BTN_TELCALL {
obj.makeButton("電話をかける", #FALSE, 0, 2, 543);
}
button BTN_TRANSFER {
obj.makeButton( "転送" , #TRUE , 0 , 2 , 544 ) ;
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//転送スクリプト起動
script.openExtern("BT_TRANS.MX", #FALSE, []);
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button DIS_BTN_TRANSFER {
obj.makeButton( "転送" , #FALSE , 0 , 2 , 545 ) ;
}
button BTN_SENDBREAK {
obj.makeButton( "" , #TRUE , 0 , 0 , 554 ) ;
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ブレーク信号の送信
com.sendBreak(50);
//マウスの復元
sys.popCursor();
}
}
button DIS_BTN_SENDBREAK {
obj.makeButton( "" , #FALSE , 0 , 0 , 555 ) ;
}
button BTN_LINEINIT {
obj.makeButton( "" , #TRUE , 0 , 0 , 556 ) ;
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ポートの初期化
com.initPort($$COM.PORT);
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button DIS_BTN_LINEINIT {
obj.makeButton( "" , #FALSE , 0 , 0 , 557 ) ;
}
button BTN_LINECUT {
obj.makeButton( "" , #TRUE , 0 , 0 , 553 ) ;
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//回線のクローズ
local.comClose();
//ツールボタンの属性変更
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_TELCALL");
obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
obj.setButton(6, #TRUE, "BTN_TELCALL");
obj.setButton(0, #TRUE, "BTN_TRANSFER");
obj.setButton(0, #TRUE, "DIS_BTN_TRANSFER");
obj.setButton(11, #TRUE, "DIS_BTN_TRANSFER");
obj.setButton(16, #TRUE, "BTN_TRANSOPERATION");
obj.setButton(0, #TRUE, "BTN_DOSCONS");
obj.setButton(21, #TRUE, "BTN_DOSCONS");
obj.setButton(0, #TRUE, "BTN_OASYS");
obj.setButton(26, #TRUE, "BTN_OASYS");
obj.setButton(0, #TRUE, "BTN_LINECUT");
obj.setButton(31, #TRUE, "DIS_BTN_LINECUT");
obj.setButton(0, #TRUE, "BTN_SENDBREAK");
obj.setButton(32, #TRUE, "DIS_BTN_SENDBREAK");
obj.setButton(0, #TRUE, "BTN_LINEINIT");
obj.setButton(33, #TRUE, "DIS_BTN_LINEINIT");
obj.setButton(0, #TRUE, "DIS_BTN_MANUTRANSEND");
obj.setButton(50, #TRUE, "BTN_MANUTRANSEND");
obj.endUpdateButton();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button DIS_BTN_LINECUT {
obj.makeButton( "" , #TRUE , 0 , 0 , 552 ) ;
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//回線のオープン
if(com.isDTR($$COM.PORT) == #FALSE) { //オープンされていない
PORTOPEN:
event.mask(@ERROR);
$ret = com.openPort($$COM.PORT, []);
//モデムの接続チェック
if($ret == #FALSE) { //CTSがONにならない
com.closePort($$COM.PORT);
$backXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize(228);
if( $$COM.PORT == -1 ) {
$portStr = "ポート番号: 内蔵";
} else {
$portStr = str.join(["ポート番号:",
data.toString( $$COM.PORT )], " " );
}
sys.popCursor();
$ret = dialog.ask([
"━━━━ ポートのオープン ━━━━",
"",
"ポートにモデムが接続されていないか",
"モデムの電源が入っていません。",
"",
$portStr
],
["中断", "再実行"]);
dialog.setDefaultXSize($backXsize);
event.unmask(@ERROR);
//マウスの変更
sys.pushCursor(81);
if($ret == 1) {
goto PORTOPEN;
}
else {
goto RETURN;
}
}
elif($ret != #TRUE) { //オープン失敗
$backXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize(228);
sys.pushCursor( 80 );
dialog.ask([
"━━━ ポートのオープン ━━━",
"",
" 回線をオープンできません。",
""],
["確認"]);
sys.popCursor();
dialog.setDefaultXSize($backXsize);
goto RETURN;
}
}
//ボタンの変更
obj.beginUpdateButton();
local.btnConnectMode();
obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
obj.setButton(6, #TRUE, "BTN_TELCALL");
obj.endUpdateButton();
RETURN:
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button BTN_ENVSET {
obj.makeButton( "手動通信の環境" , #TRUE , 0 , 2 , 540 ) ;
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//環境設定スクリプト起動
script.openExtern("BT_EVSET.MX", #FALSE, []);
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
return;
}
}
button BTN_MANUTRANSEND {
obj.makeButton( "手動通信の終了" , #TRUE , 0 , 0 , 538 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//手動通信終了関数呼出し
local.manuEnd();
//@BEGIN.SYSTEMイベント発行
event.send(@BEGIN.SYSTEM, #SYSTEM, "");
return;
}
}
button DIS_BTN_MANUTRANSEND {
obj.makeButton( "手動通信の終了" , #FALSE , 0 , 0 , 539 ) ;
}
button BTN_TEXTPAUSE {
obj.makeButton( "テキストの受信保存一時停止" , #TRUE , 0 , 1 , -1 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//テキスト受信一時停止関数呼出し
xfer.pauseText($$USER.DEFINED.1);
//ボタンの設定
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_TEXTPAUSE");
obj.setButton(41, #TRUE, "BTN_TEXTRESTART");
obj.endUpdateButton();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button BTN_TEXTRESTART {
obj.makeButton( " テキストの受信保存再開 " , #TRUE , 0 , 1 , -1 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//テキスト受信再開関数呼出し
xfer.resumeText($$USER.DEFINED.1);
//ボタンの設定
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_TEXTRESTART");
obj.setButton(41, #TRUE, "BTN_TEXTPAUSE");
obj.endUpdateButton();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button BTN_TERMINAL {
obj.makeButton( "" , #TRUE , 0 , 0 , 558 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//端末の設定ダイアログの起動
$mxPath = str.join([$$DIR.STANDARD,"SETUP\\EV_TERMI.MX"],"" );
script.openExtern( $mxPath, #FALSE, [] );
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button BTN_IDBOOK {
obj.makeButton( "" , #TRUE , 0 , 0 , 560 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//ID名簿の起動
local.btn.idbook();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button BTN_CDPG {
obj.makeButton( "" , #TRUE , 0 , 0 , 564 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//CDPGの起動
local.btn.cdpg();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button BTN_STATUSBAR {
obj.makeButton( "" , #TRUE , 0 , 0 , 562 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//ステータスバーON
$$STATUS.BAR = #TRUE;
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_STATUSBAR");
obj.setButton(48, #TRUE, "DIS_BTN_STATUSBAR");
obj.endUpdateButton();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button DIS_BTN_STATUSBAR {
obj.makeButton( "" , #TRUE , 0 , 0 , 563 ) ;
event @CLICK {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ボタンの非活性化
sys.disableButton(#TRUE);
//ステータスバーOFF
$$STATUS.BAR = #FALSE;
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "DIS_BTN_STATUSBAR");
obj.setButton(48, #TRUE, "BTN_STATUSBAR");
obj.endUpdateButton();
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
}
}
button BTN_OASYS {
obj.makeButton("OASYS文書交換" , #TRUE , 0 , 2 , 550 ) ;
event @CLICK {
//マウスの変更
sys.pushCursor(81);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//OASYS変換スクリプト起動
script.openExtern("BT_OASYS.MX", #FALSE, []);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//メニューの活性化
sys.enableMenu(#TRUE);
//マウスの復元
sys.popCursor();
return;
}
}
button BTN_DOSCONS {
obj.makeButton("コンソール" , #TRUE , 0 , 2 , 548 ) ;
event @CLICK { local.console(); }
}
button BTN_SGN_LINECUT {
obj.makeButton( "オンラインサインアップ終了" , #TRUE , 0 , 2 , 553 ) ;
event @CLICK {
sys.pushCursor(81);
local.comClose();
sys.popCursor();
return;
}
}
//---------------------- ボタンバーのボタン設定 ------------------------//
button BUTTON51 {
obj.makeButton( " 改 行" , #TRUE , 51 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("\r"); }
}
button BUTTON52 {
obj.makeButton( " T" , #TRUE , 52 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("T\r"); }
}
button BUTTON53 {
obj.makeButton( " E" , #TRUE , 53 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("E\r"); }
}
button BUTTON54 {
obj.makeButton( " 終 了" , #TRUE , 54 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("OFF\r"); }
}
button BUTTON55 {
obj.makeButton( " 1" , #TRUE , 55 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("1"); }
}
button BUTTON56 {
obj.makeButton( " 2" , #TRUE , 56 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("2"); }
}
button BUTTON57 {
obj.makeButton( " 3" , #TRUE , 57 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("3"); }
}
button BUTTON58 {
obj.makeButton( " 4" , #TRUE , 58 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("4"); }
}
button BUTTON59 {
obj.makeButton( " 5" , #TRUE , 59 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("5"); }
}
button BUTTON60 {
obj.makeButton( " 6" , #TRUE , 60 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("6"); }
}
button BUTTON61 {
obj.makeButton( " 7" , #TRUE , 61 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("7"); }
}
button BUTTON62 {
obj.makeButton( " 8" , #TRUE , 62 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("8"); }
}
button BUTTON63 {
obj.makeButton( " 9" , #TRUE , 63 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("9"); }
}
button BUTTON64 {
obj.makeButton( " 0" , #TRUE , 64 , 3 , -1 ) ;
event @CLICK { local.buttonBarFunc("0"); }
}
!!ENDBLOCK
//##########################################################################//
//### メインブロック ###//
//##########################################################################//
!!MAINBLOCK
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//+++ 各種イベントハンドラ +++//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//-------------------------------------//
//--- システムオープンイベント ---//
//-------------------------------------//
event @OPEN.SYSTEM {
//マウスカ-ソルの退避/変更
sys.pushCursor(81);
//メニューの非活性化
sys.disableMenu(#TRUE);
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//インフォメーションパネルへの表示
printxy2( 3, 2, "パ ソ コ ン 通 信" );
printxy2( 6, 3, sys.getVersion());
//時間表示の初期設定
$SaveTime = list.getNth( time.getDate(), 5 );
$DateStr = "";
sys.global( $DateStr );
sys.global( $SaveTime );
local.timePrint();
sys.enableInt("local.timePrint.int");
//ステータスバーの表示
$$STATUS.BAR = #TRUE;
//システム変数の使用
$$USER.DEFINED.0 = 0; //テキスト受信状態
$$USER.DEFINED.1 = -1; //テキスト受信ファイルID
$$USER.DEFINED.2 = #FALSE; //#TRUE:環境の変更あり #FALSE:なし
$$BIN.PROTOCOL = 3; //プロトコルはB-Plus固定
$$BIN.AUTO.B = #FALSE; //B-Plusの自動起動は常に行わない
$$BIN.BACK.BUTTON = #FALSE; //バイナリ送信のバックグランド化ボタン無し
$$BBS.LOG = #FALSE; //ログを保存しない
//自動ログ記録用変数の設定
$SysLogFileId = -1;
sys.global($SysLogFileId);
//自動通信動作記録用変数定義
$AutoDBfileName = ""; // データベースファイル名
$AutoIDXfileName = ""; // インデックスファイル名
$AutoSETfileName = ""; // 自動通信設定ファイル名
$AutoLOGfileName = ""; // ログファイル名
sys.global( $AutoDBfileName );
sys.global( $AutoIDXfileName );
sys.global( $AutoSETfileName );
sys.global( $AutoLOGfileName );
sys.global( $AutoReturn );
//手動通信モードフラグ
$ManuTransMode = #FALSE;
sys.global( $ManuTransMode );
}
//-----------------------------------------//
//--- 起動時の自動実行処理イベント ---//
//-----------------------------------------//
event @BEGIN.SYSTEM {
//アイコンボタンの定義
$AutoTransId = dialog.makeButton( 0, " 自動通信 ", 514, 0 );
$ViewerId = dialog.makeButton( 0, "文書整理/作成", 516, 0 );
$ManuTransId = dialog.makeButton( 0, " 手動通信 ", 517, 0 );
$AutoTransSetId = dialog.makeButton( 0, "自動通信の環境", 515, 0 );
$OasysConvId = dialog.makeButton( 0, "OASYS文書交換 ", 530, 0 );
$ManuTransSetId = dialog.makeButton( 0, "手動通信の環境", 518, 0 );
$OnlineSgnupId = dialog.makeButton( 0, " オンラインサインアップ ", 528, 0 );
$DosConsId = dialog.makeButton( 0, " コンソール ", 529, 0 );
$EndCaronId = dialog.makeButton( 0, " 終了 ", 512, 0x801D );
$DefaultId = $AutoTransId;
// ダイアログリストの作成
$DialogList = [ "メインメニュー" , 0 , -1 , -1 , $DefaultId ,
[ "" , $AutoTransId , [0] , [""] , [""] ] ,
[ "" , $ViewerId , [0] , [""] , [""] ] ,
[ "" , $ManuTransId , [0] , [""] , [""] ] ,
[ "" , $AutoTransSetId , [0] , [""] , [""] ] ,
[ "" , $OasysConvId , [0] , [""] , [""] ] ,
[ "" , $ManuTransSetId , [0] , [""] , [""] ] ,
[ "" , $OnlineSgnupId , [0] , [""] , [""] ] ,
[ "" , $DosConsId , [0] , [""] , [""] ] ,
[ "" , $EndCaronId , [0] , [""] , [""] ]
] ;
//メインループ
loop {
//マウスの復元
sys.popCursor();
// ダイアログの表示
dialog.open( $DialogList );
//マウスの変更
sys.pushCursor(81);
// ダイアログの復帰値を取得する
$ReturnId = list.get1st( $$DIALOG.RETURN );
table( $ReturnId ) {
$AutoTransId {local.autoTrans();}
$ViewerId {local.viewer();}
$ManuTransId {local.manuTrans();}
$AutoTransSetId {local.autoTransSet();}
$OnlineSgnupId {
//環境設定スクリプト起動
$path = str.join([$$DIR.STANDARD,
"AUTO\\SCRIPT\\AUTOSGN.MX"], "" );
script.openExtern( $path, #FALSE, []);
}
$OasysConvId {
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//OASYS変換スクリプト起動
script.openExtern("BT_OASYS.MX", #FALSE, []);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//メニューの活性化
sys.enableMenu(#TRUE);
}
$ManuTransSetId {
//ツールボタンの非活性化
sys.disableButton(#TRUE);
//メニューの非活性化
sys.disableMenu(#TRUE);
//環境設定スクリプト起動
script.openExtern("BT_EVSET.MX", #FALSE, []);
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
}
$DosConsId {local.console();}
$EndCaronId {;}
else {;}
}
if( ($ReturnId == $EndCaronId) || ($ReturnId < 0) ) {
//CARON終了イベントの発行
dialog.delButton( $AutoTransId ) ;
dialog.delButton( $ViewerId ) ;
dialog.delButton( $ManuTransId ) ;
dialog.delButton( $AutoTransSetId ) ;
dialog.delButton( $EndCaronId ) ;
dialog.delButton( $DosConsId ) ;
dialog.delButton( $ManuTransSetId ) ;
dialog.delButton( $OasysConvId ) ;
dialog.delButton( $OnlineSgnupId ) ;
sys.quitSystem();
}
elif($ReturnId == $ManuTransId) {
//手動通信を実行中は制御を返す
dialog.delButton( $AutoTransId ) ;
dialog.delButton( $ViewerId ) ;
dialog.delButton( $ManuTransId ) ;
dialog.delButton( $AutoTransSetId ) ;
dialog.delButton( $EndCaronId ) ;
dialog.delButton( $DosConsId ) ;
dialog.delButton( $ManuTransSetId ) ;
dialog.delButton( $OasysConvId ) ;
dialog.delButton( $OnlineSgnupId ) ;
exit;
}
list.delNth($DialogList, 5);
list.putNth($DialogList, 4, $ReturnId);
}
//メニューの活性化
sys.enableMenu(#TRUE);
//ツールボタンの活性化
sys.enableButton(#TRUE);
//マウスの復元
sys.popCursor();
return;
}
//----------------------------------------//
//--- 終了時の自動実行処理イベント ---//
//----------------------------------------//
event @END.SYSTEM {
//ダイアログオープン中は無条件で終了キャンセル
if( dialog.check() == #TRUE ) {
sys.cancelQuitSystem();
return;
}
//ボタン及びメニューの非活性化
sys.disableButton( #TRUE );
sys.disableMenu( #TRUE );
//回線が繋がっている場合は、終了の確認を行う
if( com.isDTR( $$COM.PORT ) == #TRUE ) {
//マウスの変更
$backXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize(228);
sys.pushCursor(80);
//ダイアログ表示
$rtn = dialog.ask([
"━━━ パソコン通信の終了 ━━━",
"",
" 回線がつながっています。 ",
" 終了すると回線が切断されます。 ",
" 終了しますか? ",
""],["いいえ", "はい"]);
dialog.setDefaultXSize($backXsize);
//マウスの復元
sys.popCursor();
if( $rtn == 0 ) {
//終了を続行しない場合は終了をキャンセルする
sys.enableButton( #TRUE );
sys.enableMenu( #TRUE );
sys.cancelQuitSystem();
return;
}
}
}
//---------------------------------------------//
//--- センタースクリプトクローズイベント ---//
//---------------------------------------------//
event @CLOSE.SCRIPT {
//環境設定の変更確認
if($$USER.DEFINED.2) {
//マウスの変更
$backXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize(228);
sys.pushCursor(80);
//ダイアログ表示
$rtn = dialog.ask([
"━━━━━━ 環境設定 ━━━━━━",
"",
"環境設定の内容が編集されています。",
"保存しますか?", ""],
["いいえ", "はい"]);
dialog.setDefaultXSize($backXsize);
//マウスの復元
sys.popCursor();
//環境を保存する場合、環境変数保存スクリプト起動
if($rtn == 1) {
$mxPath = str.join([$$DIR.STANDARD, "SETUP\\EV_SAVE.MX"], "");
script.openExtern($mxPath, #FALSE, []);
}
else {
$$USER.DEFINED.2 = #FALSE;
}
}
return;
}
//-------------------------------------//
//--- システムクローズイベント ---//
//-------------------------------------//
event @CLOSE.SYSTEM {
//マウスの変更
sys.pushCursor(81);
// 手動通信モードにあるなら終了させる
if ($ManuTransMode == #TRUE) {
sys.pushCursor(81); // マウスの時計化
local.manuEnd();
sys.popCursor(); // マウスの復元
}
//回線がオープンされていればクローズする
if( com.isDTR($$COM.PORT) == #TRUE ) {
local.comClose();
}
//グローバルデータのローカル化
sys.deleteInt("local.timePrint.int");
sys.local($DateStr);
sys.local($SaveTime);
sys.local($SysLogFileId);
sys.local($AutoDBfileName);
sys.local($AutoIDXfileName);
sys.local($AutoSETfileName);
sys.local($AutoLOGfileName);
sys.local($AutoReturn);
// 動作中のスクリプトを強制中断
script.stop();
}
//--------------------------//
//--- エラーイベント ---//
//--------------------------//
event @ERROR {
local.errorFunc();
event.mainLoop();
}
//------------------------------//
//--- ファイル転送エラー ---//
//------------------------------//
event @ERROR.PROTOCOL {
$$ERROR.PROTOCOL = xfer.openErrorDialog(
list.get1st( $$ERROR.PROTOCOL ),
list.getNth( $$ERROR.PROTOCOL, 2 ));
return;
}
//------------------------------//
//--- 汎用エラールーチン ---//
//------------------------------//
function local.errorFunc() {
//--- ダイアログが出ている場合は、消す ---//
if( dialog.check() == #TRUE ) {
dialog.close();
}
//--- エラーダイアログの表示を行う ---//
$error = $$ERROR;
list.delNth( $error, 6 );
list.putNth( $error, 5, ["メインループへ戻る"] );
dialog.error( $error );
//--- メインダイアログが出るように細工する ---//
if( script.exec?() == 2 ) {
sys.enableMenu( #FALSE );
sys.enableButton( #FALSE );
if( $ManuTransMode == #FALSE ) {
event.push( @BEGIN.SYSTEM, #SYSTEM, #MAIN, #FALSE );
}
}
//--- マウスカーソルをとりあえず矢印に戻す ---//
sys.changeCursor( 80 );
return;
}
//--------------------------------//
//--- ハングアップイベント ---//
//--------------------------------//
event @TIM.HANGUP {
//回線切断イベントの発行
event.send( @DISCONNECT, #SYSTEM, #MAIN );
//メッセージの表示
$backXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize(312);
$string = str.join([data.toString( $$TIM.HANGUP + 1 ),
"分間操作が無かったため、回線を切断しました。"], "" );
dialog.ask([
"━━━━━━━━ オフタイマー ━━━━━━━━",
"",
$string,
""],
["確認"]);
dialog.setDefaultXSize($backXsize);
}
//----------------------------//
//--- 回線接続イベント ---//
//----------------------------//
event @CONNECT {
sys.disableButton(#TRUE);
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_TELCALL");
obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
obj.setButton(6, #TRUE, "DIS_BTN_TELCALL");
obj.endUpdateButton();
sys.enableButton(#TRUE);
}
//----------------------------//
//--- 回線切断イベント ---//
//----------------------------//
event @DISCONNECT {
sys.disableButton(#TRUE);
sys.pushCursor(81);
if( $ManuTransMode == #TRUE ) {
obj.beginUpdateButton();
}
//回線のクローズ
local.comClose();
//手動通信の時、ツールボタンの属性を変更する
if( $ManuTransMode == #TRUE ) {
obj.setButton( 0, #TRUE, "BTN_TELCALL" );
obj.setButton( 0, #TRUE, "DIS_BTN_TELCALL" );
obj.setButton( 6, #TRUE, "BTN_TELCALL" );
obj.setButton( 0, #TRUE, "BTN_TRANSFER" );
obj.setButton( 0, #TRUE, "DIS_BTN_TRANSFER" );
obj.setButton( 11, #TRUE, "DIS_BTN_TRANSFER" );
obj.setButton( 16, #TRUE, "BTN_TRANSOPERATION" );
obj.setButton( 0, #TRUE, "BTN_DOSCONS" );
obj.setButton( 21, #TRUE, "BTN_DOSCONS" );
obj.setButton( 0, #TRUE, "BTN_OASYS" );
obj.setButton( 26, #TRUE, "BTN_OASYS" );
obj.setButton( 0, #TRUE, "BTN_LINECUT" );
obj.setButton( 31, #TRUE, "DIS_BTN_LINECUT" );
obj.setButton( 0, #TRUE, "BTN_SENDBREAK" );
obj.setButton( 32, #TRUE, "DIS_BTN_SENDBREAK" );
obj.setButton( 0, #TRUE, "BTN_LINEINIT" );
obj.setButton( 33, #TRUE, "DIS_BTN_LINEINIT" );
obj.setButton( 0, #TRUE, "DIS_BTN_MANUTRANSEND");
obj.setButton( 50, #TRUE, "BTN_MANUTRANSEND" );
obj.endUpdateButton();
}
sys.popCursor();
sys.enableButton(#TRUE);
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//+++ 各種内部関数 +++//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//---------------------- システムスクリプト用 ------------------------//
//--------------------------------//
//--- ボタンバー呼出し関数 ---//
//--------------------------------//
function local.buttonBarFunc($str) { //送信文字列
//ポートがオープンされていれば文字を送信する
if(com.isDTR($$COM.PORT) == #TRUE) {
com.putString($str, []);
}
return;
}
//----------------------------------//
//--- 時計更新用割り込み関数 ---//
//----------------------------------//
interrupt local.timePrint.int( 2, 1 ) { //インターバルタイマ割り込み(1秒毎)
$min = list.getNth( time.getDate(), 5 );
if( $min != $SaveTime ) {
$SaveTime = $min;
local.timePrint();
}
return;
}
//------------------------//
//--- 時計表示関数 ---//
//------------------------//
function local.timePrint() {
$numList = time.getDate();
$listStr = [];
$cnt = 1;
loop {
if( $cnt == 1 ) {
$str = data.toString2( list.getNth( $numList, $cnt ), 4, "0", 0 );
} else {
$str = data.toString2( list.getNth( $numList, $cnt ), 2, "0", 0 );
}
$listStr = list.putLast( $listStr, $str );
if( $cnt == 3 ) {
$str = str.join( $listStr,"/" );
if( $DateStr != $str ) {
$DateStr = $str;
printxy2( 6, 6, $DateStr );
}
$listStr = [];
} elif( $cnt == 5 ) {
foreach( $a, $listStr ) {
$b = 0;
}
$str = str.join( $listStr, ":" );
printxy2( 8, 7, $str );
exit;
}
$cnt = $cnt + 1;
}
}
//---------------------- メインダイアログ ----------------------------//
//---------------------//
//--- 自動通信 ---//
//---------------------//
function local.autoTrans() {
$path = str.join([$$DIR.STANDARD, "AUTO\\SCRIPT\\AUTOMAIN.MX"], "" );
script.openExtern( $path, #FALSE, [] );
return;
}
//-------------------------//
//--- 文書整理/作成 ---//
//-------------------------//
function local.viewer() {
sys.popCursor();
event.mask( @ERROR );
$rtn = mod.viewer( "", "", "", "" );
if( $rtn == #ERROR ) {
$saveXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize( 228 );
sys.pushCursor( 80 );
dialog.ask(["━━━━ 文書整理/作成 ━━━━",
"",
" 文書整理/作成を実行できません。",
""],["確認"] );
sys.popCursor();
dialog.setDefaultXSize( $saveXsize );
}
event.unmask( @ERROR );
sys.pushCursor(81);
return;
}
//-----------------//
//--- 通信 ---//
//-----------------//
function local.manuTrans() {
//ツ-ルパネルにボタンを表示する
obj.beginUpdateButton();
obj.setButton(1, #TRUE, "BTN_ENVSET");
obj.setButton(6, #TRUE, "BTN_TELCALL");
obj.setButton(11, #TRUE, "DIS_BTN_TRANSFER");
obj.setButton(16, #TRUE, "BTN_TRANSOPERATION");
obj.setButton(21, #TRUE, "BTN_DOSCONS");
obj.setButton(26, #TRUE, "BTN_OASYS");
obj.setButton(31, #TRUE, "DIS_BTN_LINECUT");
obj.setButton(32, #TRUE, "DIS_BTN_SENDBREAK");
obj.setButton(33, #TRUE, "DIS_BTN_LINEINIT");
obj.setButton(46, #TRUE, "BTN_TERMINAL");
obj.setButton(47, #TRUE, "BTN_IDBOOK");
obj.setButton(48, #TRUE, "DIS_BTN_STATUSBAR");
// obj.setButton(49, #TRUE, "BTN_CDPG");
obj.setButton(50, #TRUE, "BTN_MANUTRANSEND");
obj.endUpdateButton();
//手動通信モードに切り換えた
$ManuTransMode = #TRUE;
return;
}
//-----------------------------//
//--- 自動通信環境の設定 ---//
//-----------------------------//
function local.autoTransSet() {
//自動通信環境設定スクリプト起動
script.openExtern("AUTO_ENV.MX", #FALSE, []);
return;
}
//----------------------------//
//--- DOSコンソール ---//
//----------------------------//
function local.console()
{
//--- リアルメモリのチェック ---//
if( sys.checkMaxReal() < 1024 * 150 ) {
$saveXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize( 324 );
sys.pushCursor( 80 );
dialog.ask(["━━━━━━━━━ コンソール ━━━━━━━━━",
"",
" 拡張機能が設定されていません。 ",
" システム設定の拡張機能で「通信機能のコンソール」",
"を設定してください。 ",
""],["確認"] );
sys.popCursor();
dialog.setDefaultXSize( $saveXsize );
return;
}
mod.console();
return;
}
//---------------------- ツールパネル ----------------------------//
//-----------------------------//
//--- 手動通信の終了処理 ---//
//-----------------------------//
function local.manuEnd() {
//ツールパネルのボタンを非表示にする
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_ENVSET");
obj.setButton(0, #TRUE, "BTN_TELCALL");
obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
obj.setButton(0, #TRUE, "BTN_TRANSFER");
obj.setButton(0, #TRUE, "DIS_BTN_TRANSFER");
obj.setButton(0, #TRUE, "BTN_TRANSOPERATION");
obj.setButton(0, #TRUE, "BTN_DOSCONS");
obj.setButton(0, #TRUE, "BTN_OASYS");
obj.setButton(0, #TRUE, "BTN_LINECUT");
obj.setButton(0, #TRUE, "DIS_BTN_LINECUT");
obj.setButton(0, #TRUE, "BTN_SENDBREAK");
obj.setButton(0, #TRUE, "DIS_BTN_SENDBREAK");
obj.setButton(0, #TRUE, "BTN_LINEINIT");
obj.setButton(0, #TRUE, "DIS_BTN_LINEINIT");
obj.setButton(0, #TRUE, "BTN_TERMINAL");
obj.setButton(0, #TRUE, "BTN_IDBOOK");
// obj.setButton(0, #TRUE, "BTN_CDPG");
obj.setButton(0, #TRUE, "BTN_STATUSBAR");
obj.setButton(0, #TRUE, "DIS_BTN_STATUSBAR");
obj.setButton(0, #TRUE, "BTN_MANUTRANSEND");
obj.setButton(0, #TRUE, "DIS_BTN_MANUTRANSEND");
obj.endUpdateButton();
//手動通信モードを終わった
$ManuTransMode = #FALSE;
return;
}
//--------------------------//
//--- ID名簿の起動 ---//
//--------------------------//
function local.btn.idbook()
{
$ret = mod.idBase( 0, #FALSE );
if( $ret == #FALSE ) {
//--- どこかで使用中である ---//
$saveXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize( 312 );
sys.pushCursor( 80 );
dialog.ask(["━━━━━━━━━ ID名簿 ━━━━━━━━━",
"",
" ID名簿がすでに他プロセスで使用されています。",
" 起動中のID名簿を終了させて下さい。 ",
""],["確認"] );
sys.popCursor();
dialog.setDefaultXSize( $saveXsize );
return;
}
//--- 取り消された ---//
if( list.size( $ret ) == 0 ) {
return;
}
//--- 通信中であれば、選択した内容を送信する ---//
if( com.isDTR( $$COM.PORT ) == #TRUE ) {
com.putString( list.get1st( $ret ), [] );
}
return;
}
//--------------------------//
//--- CDPGの起動 ---//
//--------------------------//
function local.btn.cdpg()
{
$path = str.join ( [$$DIR.STANDARD,"CDPG.EXG" ] , "" );
mod.exec( $path ,"", #TRUE );
return;
}
//--------------------------------//
//--- 手動通信モードの取得 ---//
//--------------------------------//
function local.getManuTransMode() {
return( $ManuTransMode );
}
//-------------------------//
//--- 電話をかける ---//
//-------------------------//
function local.btn.telCall() {
CONTINUE_P:
//--- 電話帳スクリプトの起動 ---//
script.openExtern("TELBOOK.MX", #FALSE, [] );
if( $$USER.DEFINED.9 == #FALSE ) {
//--- 取消し、もしくは異常終了 ---//
return;
}
//--- センタースクリプトの切り替え ---//
$envFile = list.getNth( $$USER.DEFINED.9, 6 );
if( $envFile != "" ) {
$centerFile = script.status( #CENTER, 1 );
if( list.size( $centerFile ) == 0 ) {
//--- センタースクリプトが読まれていない ---//
$centerFile = "";
} else {
$centerFile = list.get1st( $centerFile );
}
if( $centerFile != $envFile ) {
event.mask( @ERROR );
if( script.open( $envFile, #TRUE, [] ) != #TRUE ) {
event.unmask( @ERROR );
$backXsize = dialog.getDefaultXSize();
dialog.setDefaultXSize( 300 );
sys.popCursor();
dialog.ask([
"━━━━━━━━ 電話をかける ━━━━━━━━",
"",
" 環境ファイルが読み込めません。",
" 電話帳の「編集」で環境ファイル名を確認して",
" ください。", ""],
["確認"]);
dialog.setDefaultXSize( $backXsize );
sys.pushCursor( 81 );
script.open( $centerFile, #FALSE, [] );
return;
}
event.unmask( @ERROR );
}
}
//--- システム変数のバックアップを作成 ---//
$telDialBackup = [$$BBS.NAME,$$BBS.TEL1,$$BBS.TEL2,$$BBS.TEL3,
$$BBS.REDIAL,$$BBS.REDIAL.WAIT];
//--- システム変数設定 ---//
$$BBS.TEL1 = list.getNth( $$USER.DEFINED.9, 1 );
$$BBS.TEL2 = list.getNth( $$USER.DEFINED.9, 2 );
$$BBS.TEL3 = list.getNth( $$USER.DEFINED.9, 3 );
$$BBS.REDIAL = list.getNth( $$USER.DEFINED.9, 4 );
$$BBS.REDIAL.WAIT = list.getNth( $$USER.DEFINED.9, 5 );
//--- ダイアルスクリプトを実行 ---//
event.mask( @CONNECT );
sys.pushCursor( 81 );
script.openExtern("MANUDIAL.MX", #FALSE, []);
sys.popCursor();
event.unmask( @CONNECT );
//--- システム変数を元に戻す ---//
$$BBS.NAME = list.getNth( $telDialBackup, 1 );
$$BBS.TEL1 = list.getNth( $telDialBackup, 2 );
$$BBS.TEL2 = list.getNth( $telDialBackup, 3 );
$$BBS.TEL3 = list.getNth( $telDialBackup, 4 );
$$BBS.REDIAL = list.getNth( $telDialBackup, 5 );
$$BBS.REDIAL.WAIT = list.getNth( $telDialBackup, 6 );
//--- 復帰値の確認 ---//
if( $$USER.DEFINED.9 == #TRUE ) {
local.btnConnectMode();
} else {
goto CONTINUE_P;
}
return;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//+++ 通信ライブラリ関数 +++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//------------------------//
//--- 回線クローズ ---//
//------------------------//
function local.comClose() {
//自動ログ記録中の場合、そのファイルをクローズする
if($SysLogFileId != -1 ) {
xfer.endText($SysLogFileId);
file.close($SysLogFileId);
$SysLogFileId = -1;
}
// テキスト受信中の場合は終了する
if($$USER.DEFINED.0 != 0) {
xfer.endText($$USER.DEFINED.1);
file.close($$USER.DEFINED.1);
$$USER.DEFINED.1 = -1;
$$USER.DEFINED.0 = 0;
//一時停止ボタンを消去
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_TEXTPAUSE");
obj.setButton(0, #TRUE, "BTN_TEXTRESTART");
obj.endUpdateButton();
//マウスの変更
sys.changeCursor(80);
}
//--- 手動通信モードの場合は、回線クローズボタンを ---//
//--- 回線オープンボタンに切り替える ---//
if( $ManuTransMode == #TRUE ) {
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "BTN_TELCALL");
obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
obj.setButton(6, #TRUE, "BTN_TELCALL");
obj.endUpdateButton();
}
//ポートのクローズ
// if( com.isDTR( $$COM.PORT ) == #TRUE ) {
com.closePort($$COM.PORT);
// }
$$USER.DEFINED.9 = #FALSE;
return;
}
//----------------------------------------------//
//--- デフォルトモデム初期化文字列の取得 ---//
//----------------------------------------------//
function local.getDefaultInit(
$port, // ポート番号
$ec, // MNP 使用フラグ
$hflow, // ハードウェアフロー使用フラグ
$sflow ) // ソフトウェアフロー使用フラグ
{
$cmd = ["AT"];
//--- デフォルト初期化コマンド ---//
$cmd = list.putLast( $cmd, modem.getCommand( $port, 1 ));
//--- MNP の設定 ---//
if( $ec == #TRUE ) {
list.putLast( $cmd, modem.getCommand( $port, 13 ));
} elif( $ec == #FALSE ) {
list.putLast( $cmd, modem.getCommand( $port, 14 ));
}
//--- フロー制御の設定 ---//
$sflow.on.cmd = modem.getCommand( $port, 15 );
$sflow.off.cmd = modem.getCommand( $port, 16 );
$hflow.on.cmd = modem.getCommand( $port, 17 );
$hflow.off.cmd = modem.getCommand( $port, 18 );
if( $hflow == #TRUE ) {
list.putLast( $cmd, $hflow.on.cmd );
} elif( $sflow == #TRUE ) {
list.putLast( $cmd, $sflow.on.cmd );
}
if(( $hflow == #TRUE )&&( $sflow == #FALSE )) {
if( $hflow.off.cmd != $sflow.off.cmd ) {
list.putLast( $cmd, $sflow.off.cmd );
}
} elif(( $sflow == #TRUE )&&( $hflow == #FALSE )) {
if( $sflow.off.cmd != $hflow.off.cmd ) {
list.putLast( $cmd, $hflow.off.cmd );
}
} else {
list.putLast( $cmd, $hflow.off.cmd );
if( $sflow.off.cmd != $hflow.off.cmd ) {
list.putLast( $cmd, $sflow.off.cmd );
}
}
//--- コマンドをまとめて復帰する ---//
return( str.join( $cmd, "" ));
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//+++ 自動通信環境設定関数 +++//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
//--------------------------------//
//--- 環境ファイル読み込み ---//
//--------------------------------//
function local.readEnvFile($envFile) {
//--- 設定ファイルが無い場合は ---//
//--- 現在の環境を元に設定リストを作成する ---//
if( file.exist( $envFile ) == #FALSE ) {
$drive = str.left( $$DIR.STANDARD, 1 );
if( $drive == "Q" ) { // CD運用時
$saveDir = "A:\\USER";
} else { // HD運用時
$saveDir = str.join([$$DIR.STANDARD, "USER"], "");
}
$softFlow = $$COM.SOFT.FLOW;
$hardFlow = $$COM.HARD.FLOW;
if(( $softFlow == #FALSE )&&( $hardFlow == #FALSE )) {
$hardFlow = #TRUE;
}
$list = [
$$COM.PORT, // 接続ポート 1
$$COM.BAUD, // ボーレート 2
$$COM.DATA, // データ長 3
$$COM.PARITY, // パリティ 4
$$COM.SBIT, // ストップビット 5
$softFlow, // ハードウェアフロー 6
$hardFlow, // ソフトウェアフロー 7
$$COM.8BIT, // 8ビット目のマスク 8
$$MDM.DEFAULT.INIT, // デフォルトコマンド 9
$$MDM.EC, // MNPオン/オフ 10
$$MDM.INIT1, // 初期化コマンド1 11
$$MDM.INIT2, // 初期化コマンド2 12
$$MDM.INIT3, // 初期化コマンド3 13
[], // ポート情報リスト1 14
[], // ポート情報リスト2 15
[], // パルス指定可/不可 16
$$COL.TRM.CHR, // 通信画面文字色 17
$$COL.TRM.BACK, // 通信画面背景色 18
$$COL.EDT.CHR, // エディタ文字色 19
$$COL.EDT.BACK, // エディタ背景色 20
$saveDir, // 保存ディレクトリ 21
"", // ID 22
"", // パスワード 23
"", // 市外局番 24
0, // デフォルトアクセスポイント 25
#FALSE, // ユーザ設定初期化設定 26
"", // シリアルナンバー 27
"", // アグリーメントナンバー 28
3, // リダイアル回数 29
10, // リダイアル待ち時間 30
$$COL.TRM.CUR, // 通信画面カーソル色 31
$$COL.EDT.CUR, // エディタカーソル色 32
];
return( $list );
}
//--- 設定ファイルを読み込み、設定リストを作成する ---//
$fd = file.open( $envFile, "", 1 );
$i = 1;
loop {
$str = file.getString( $fd );
//--- ファイルが途中で終わっている? ---//
if( data.getType( $str ) != #STRING ) {
file.close( $fd );
return( #FALSE );
}
$str = str.replaceAll( $str, "\n", "" );
table( $i ) {
1 { $type = #STRING; } // ID
2 { $type = #STRING; } // パスワード
3 { $type = #NUMBER; } // ボーレート
4 { $type = #CONST; } // ソフトウェアフロー制御
5 { $type = #CONST; } // ハードウェアフロー制御
6 { $type = #CONST; } // MNP
7 { $type = #NUMBER; } // 接続ポート
8 { $type = #CONST; } // デフォルトコマンド
9 { $type = #CONST; } // ユーザ設定初期化コマンド
10 { $type = #STRING; } // 初期化コマンド1
11 { $type = #STRING; } // 初期化コマンド2
12 { $type = #STRING; } // 初期化コマンド3
13 { $type = #NUMBER; } // 通信画面文字色
14 { $type = #NUMBER; } // 通信画面背景色
15 { $type = #NUMBER; } // エディタカーソル色
16 { $type = #NUMBER; } // エディタ文字色
17 { $type = #NUMBER; } // エディタ背景色
18 { $type = #NUMBER; } // 通信画面カーソル色
19 { $type = #STRING; } // 保存ディレクトリ
20 { $type = #STRING; } // 市外局番
21 { $type = #NUMBER; } // デフォルトアクセスポイント
22 { $type = #STRING; } // シリアルナンバー
23 { $type = #STRING; } // アグリーメントナンバー
24 { $type = #NUMBER; } // リダイアル回数
25 { $type = #NUMBER; } // リダイアル待ち時間
}
table( $type ) {
#STRING { $data = $str; }
#NUMBER { $data = data.toNumber( $str ); }
#CONST {
if( $str == "#TRUE" ) {
$data = #TRUE;
} else {
$data = #FALSE;
}
}
}
table( $i ) {
1 { $id = $data; }
2 { $password = $data; }
3 { $baud = $data; }
4 { $softFlow = $data; }
5 { $hardFlow = $data; }
6 { $mnp = $data; }
7 { $port = $data; }
8 { $default = $data; }
9 { $custom = $data; }
10 { $init1 = $data; }
11 { $init2 = $data; }
12 { $init3 = $data; }
13 { $trmChr = $data; }
14 { $trmBak = $data; }
15 { $trmCur = $data; }
16 { $edtChr = $data; }
17 { $edtBak = $data; }
18 { $edtCur = $data; }
19 { $saveDir = $data; }
20 { $cityNo = $data; }
21 { $defAP = $data; }
22 { $serial = $data; }
23 { $agreement= $data; }
24 { $redial = $data; }
25 { $redialw = $data; }
}
$i = $i + 1;
if( $i == 26 ) {
exit;
}
}
file.close( $fd );
//--- 設定リストを生成する ---//
$list = [
$port,
$baud,
$$COM.DATA,
$$COM.PARITY,
$$COM.SBIT,
$softFlow,
$hardFlow,
$$COM.8BIT,
$default,
$mnp,
$init1,
$init2,
$init3,
[],
[],
[],
$trmChr,
$trmBak,
$edtChr,
$edtBak,
$saveDir,
$id,
$password,
$cityNo,
$defAP,
$custom,
$serial,
$agreement,
$redial,
$redialw,
$trmCur,
$edtCur
];
return( $list );
}
//------------------------------//
//--- 自動通信環境の設定 ---//
//------------------------------//
function local.loadAutoEnv(
$envFile, // 設定ファイル名
$telNo, // 電話番号
$MNP, // MNP使用可/不可
$redialNum, // リダイアル回数
$redialTime ) // リダイアル待ち時間
{
//--- 自動通信環境の読み込み ---//
$rtn = local.readEnvFile( $envFile );
if( $rtn != #FALSE ) {
//--- 変更するシステム変数の退避 ---//
$sysValList = [$$BBS.ID, $$BBS.PASSWORD, $$COM.BAUD, $$COM.SOFT.FLOW,
$$COM.HARD.FLOW, $$COM.PORT, $$COL.TRM.CHR, $$COL.TRM.BACK,
$$COL.EDT.CHR, $$COL.EDT.BACK, $$CENTER.TYPE,
$$MDM.INIT1, $$MDM.INIT2, $$MDM.INIT3, $$MDM.DEFAULT.INIT,
$$BIN.PROTOCOL, $$BIN.AUTO.B, $$DIR.LOG, $$TTX.NO.CODE.CONV,
$$TIM.HANGUP, $$BBS.TEL1, $$BBS.TEL2, $$BBS.TEL3, $$MDM.EC,
$$BBS.REDIAL, $$BBS.REDIAL.WAIT, $$TRM.SET.RSTABLE, $$TRM.RSTABLE,
$$MDM.CUSTOM.INIT, $$COL.TRM.CUR, $$COL.EDT.CUR, $$BBS.TYPE,
$$TRM.EOL, $$TRM.CR.OPTION, $$TRM.KANJI.CODE
];
sys.global( $sysValList );
//--- システム変数の設定 ---//
$$COM.PORT = list.getNth( $rtn, 1 );
$$COM.BAUD = list.getNth( $rtn, 2 );
$$COM.SOFT.FLOW = list.getNth( $rtn, 6 );
$$COM.HARD.FLOW = list.getNth( $rtn, 7 );
$$MDM.DEFAULT.INIT = list.getNth( $rtn, 9 );
$$MDM.CUSTOM.INIT = list.getNth( $rtn, 26 );
$$MDM.INIT1 = list.getNth( $rtn, 11 );
$$MDM.INIT2 = list.getNth( $rtn, 12 );
$$MDM.INIT3 = list.getNth( $rtn, 13 );
$$COL.TRM.CHR = list.getNth( $rtn, 17 );
$$COL.TRM.BACK = list.getNth( $rtn, 18 );
$$COL.TRM.CUR = list.getNth( $rtn, 31 );
$$COL.EDT.CHR = list.getNth( $rtn, 19 );
$$COL.EDT.BACK = list.getNth( $rtn, 20 );
$$COL.EDT.CUR = list.getNth( $rtn, 32 );
$$DIR.LOG = list.getNth( $rtn, 21 );
$$BBS.ID = list.getNth( $rtn, 22 );
$$BBS.PASSWORD = list.getNth( $rtn, 23 );
if(( $MNP == #TRUE )&&( list.getNth( $rtn, 10 ))) {
$$MDM.EC = #TRUE;
}
$$CENTER.TYPE = ["NIFTY-Serve"];
$$BIN.PROTOCOL = 3;
$$BIN.AUTO.B = #FALSE;
$$TTX.NO.CODE.CONV = #FALSE;
$$TIM.HANGUP = 0;
$$BBS.TEL1 = $telNo;
$$BBS.TEL2 = "";
$$BBS.TEL3 = "";
$$BBS.REDIAL = $redialNum;
$$BBS.REDIAL.WAIT = $redialTime;
$$TRM.EOL = "\r";
$$TRM.CR.OPTION = "\r";
$$TRM.KANJI.CODE = 0;
$rtn = [list.getNth( $rtn, 24 ), list.getNth( $rtn, 25 )];
}
return( $rtn );
}
//----------------------------------------------------------//
//--- 自動通信環境の設定で変更したシステム変数の復元 ---//
//----------------------------------------------------------//
function local.restoreAutoEnv() {
$j = 0;
foreach( $i, $sysValList ) {
table($j) {
0 { $$BBS.ID = $i; }
1 { $$BBS.PASSWORD = $i; }
2 { $$COM.BAUD = $i; }
3 { $$COM.SOFT.FLOW = $i; }
4 { $$COM.HARD.FLOW = $i; }
5 { $$COM.PORT = $i; }
6 { $$COL.TRM.CHR = $i; }
7 { $$COL.TRM.BACK = $i; }
8 { $$COL.EDT.CHR = $i; }
9 { $$COL.EDT.BACK = $i; }
10 { $$CENTER.TYPE = $i; }
11 { $$MDM.INIT1 = $i; }
12 { $$MDM.INIT2 = $i; }
13 { $$MDM.INIT3 = $i; }
14 { $$MDM.DEFAULT.INIT = $i; }
15 { $$BIN.PROTOCOL = $i; }
16 { $$BIN.AUTO.B = $i; }
17 { $$DIR.LOG = $i; }
18 { $$TTX.NO.CODE.CONV = $i; }
19 { $$TIM.HANGUP = $i; }
20 { $$BBS.TEL1 = $i; }
21 { $$BBS.TEL2 = $i; }
22 { $$BBS.TEL3 = $i; }
23 { $$MDM.EC = $i; }
24 { $$BBS.REDIAL = $i; }
25 { $$BBS.REDIAL.WAIT = $i; }
26 { $$TRM.SET.RSTABLE = $i; }
27 { $$TRM.RSTABLE = $i; }
28 { $$MDM.CUSTOM.INIT = $i; }
29 { $$COL.TRM.CUR = $i; }
30 { $$COL.EDT.CUR = $i; }
31 { $$BBS.TYPE = $i; }
32 { $$TRM.EOL = $i; }
33 { $$TRM.CR.OPTION = $i; }
34 { $$TRM.KANJI.CODE = $i; }
}
$j = $j + 1;
}
sys.local( $sysValList );
return;
}
//--------------------------------------------//
//--- 自動通信中断チェック割り込み関数 ---//
//--------------------------------------------//
interrupt AUTO.interruptFunc( 2, 3 ) {
if(( dialog.check() == #FALSE )||( com.isCD( $$COM.PORT ) == #FALSE )) {
sys.deleteInt("AUTO.interruptFunc");
sys.popCursor();
event.send( @AUTO.HALT, #EXTERN, #MAIN );
}
return;
}
//----------------------------------//
//--- 自動通信実行状態の記録 ---//
//----------------------------------//
function local.setAutoName(
$AutoDBfileName, // データベースファイル名
$AutoIDXfileName, // インデックスファイル名
$AutoSETfileName, // 自動通信設定ファイル名
$AutoLOGfileName ) // ログファイル名
{
return;
}
//-------------------------------------------------//
//--- ツールパネルのボタンを通信中状態にする ---//
//-------------------------------------------------//
function local.btnConnectMode() {
obj.beginUpdateButton();
obj.setButton(0, #TRUE, "DIS_BTN_TELCALL");
obj.setButton(0, #TRUE, "BTN_TELCALL");
obj.setButton(6, #TRUE, "DIS_BTN_TELCALL");
obj.setButton(0, #TRUE, "DIS_BTN_TRANSFER");
obj.setButton(0, #TRUE, "BTN_TRANSFER");
obj.setButton(11, #TRUE, "BTN_TRANSFER");
obj.setButton(0, #TRUE, "BTN_DOSCONS");
obj.setButton(21, #TRUE, "BTN_DOSCONS");
obj.setButton(16, #TRUE, "BTN_TRANSOPERATION");
obj.setButton(0, #TRUE, "BTN_OASYS");
obj.setButton(26, #TRUE, "BTN_OASYS");
obj.setButton(0, #TRUE, "DIS_BTN_LINECUT");
obj.setButton(0, #TRUE, "BTN_LINECUT");
obj.setButton(31, #TRUE, "BTN_LINECUT");
obj.setButton(0, #TRUE, "DIS_BTN_SENDBREAK");
obj.setButton(0, #TRUE, "BTN_SENDBREAK");
obj.setButton(32, #TRUE, "BTN_SENDBREAK");
obj.setButton(0, #TRUE, "DIS_BTN_LINEINIT");
obj.setButton(0, #TRUE, "BTN_LINEINIT");
obj.setButton(33, #TRUE, "BTN_LINEINIT");
obj.setButton(0, #TRUE, "BTN_MANUTRANSEND");
obj.setButton(0, #TRUE, "DIS_BTN_MANUTRANSEND");
obj.setButton(50, #TRUE, "DIS_BTN_MANUTRANSEND");
obj.endUpdateButton();
return;
}
//----------------------------------------//
//--- アクセスポイントリストの取得 ---//
//----------------------------------------//
function AUTO.getAPlist(
$trdId, // APファイルのTRD識別子
$no ) // 対象TRD ID(-1:ALL)
{
if( $no == -1 ) {
$topTag = [-5, -2];
} else {
$topTag = [$no, -2];
}
$apList = [];
loop {
//--- トップレベルのグループの読み込み ---//
$list = [];
$retList = trd.getData( $trdId, $topTag );
if( list.get1st( $retList ) != -2 ) {
exit;
}
$wkList = str.split( list.getNth( $retList, 2 ), "\t" );
list.putLast( $list, list.getNth( $wkList, 1 ));
if( list.size( $wkList ) == 1 ) {
list.putLast( $list, "" );
} else {
list.putLast( $list, list.getNth( $wkList, 2 ));
}
trd.getDataPush( $trdId );
//--- グループ内の最初の1つのデータを取得する ---//
$tagNo = list.get1st( list.getLast( $retList ));
$i = 1;
loop {
$tag = [$tagNo, $i, -2];
$retList = trd.checkList( $trdId, $tag );
if( list.get1st( $retList ) == -2 ) {
$tagNoSub = list.getNth( list.getLast( $retList ), 2 );
exit;
}
$i = $i + 1;
if( $i == 9 ) {
exit;
}
}
if( $i == 9 ) {
$topTag = [];
continue;
}
$tag = [$tagNo, $tagNoSub, -2];
$retList = trd.getData( $trdId, $tag );
list.putLast( $list, list.getNth( $retList, 2 ));
//--- ボーレート、属性、電話番号の取得 ---//
$tag = list.getLast( $retList );
$no = 1;
loop {
list.delNth( $tag, 3 );
list.putNth( $tag, 2, $no );
$retList = trd.getData( $trdId, $tag );
$data = list.getNth( $retList, 2 );
if( $no != 3 ) {
$data = str.split( $data, "," );
}
list.putLast( $list, $data );
$no = $no + 1;
if( $no == 4 ) {
exit;
}
}
//--- アクセスポイント1件のデータ設定 ---//
list.putLast( $list, [$tagNo, $tagNoSub] );
list.putLast( $apList, $list );
trd.getDataPop( $trdId );
$topTag = [];
}
return( $apList );
}
//------------------------------------//
//--- アクセスポイント名の取得 ---//
//------------------------------------//
function AUTO.getApName(
$tagNo ) // 対象タグNo.
{
//--- 登録アクセスポイントファイルのオープン ---//
$trdId = trd.init( 9120, -1 );
$path = str.join([$$DIR.STANDARD, "PUBLIC\\APUSER.TRD"],"" );
if( file.exist( $path ) == #FALSE ) {
//--- ファイルが無い ---//
return("");
}
trd.load( $trdId, $path );
//--- 対象のAPデータの読み込み ---//
$apList = AUTO.getAPlist( $trdId, $tagNo );
trd.end( $trdId );
if( list.size( $apList ) == 0 ) {
//--- 指定のAPデータが見つからなかった ---//
return("");
}
$apList = list.get1st( $apList );
//--- AP名を加工する ---//
$list = [];
list.putLast( $list, list.getNth( $apList, 1 ));
list.putLast( $list, " " );
$wkList = list.getNth( $apList, 4 );
list.putLast( $list, list.get1st( $wkList ));
if( list.size( $wkList ) > 1 ) {
list.putLast( $list, "/" );
list.putLast( $list, list.getNth( $wkList, 2 ));
}
list.putLast( $list, "bps " );
list.putLast( $list, list.getNth( $apList, 3 ));
list.putLast( $list, " : " );
if( list.getNth( $apList, 2 ) != "" ) {
list.putLast( $list, list.getNth( $apList, 2 ));
list.putLast( $list, "-" );
}
list.putLast( $list, list.getNth( $apList, 6 ));
return( str.join( $list, "" ));
}
//----------------------------------------------//
//--- ダイアログからの復帰値の獲得/設定 ---//
//----------------------------------------------//
function AUTO.getDialogReturn() {
return( $AutoReturn );
}
function AUTO.setDialogReturn( $AutoReturn ) {
return;
}
!!ENDBLOCK